 <meta charset="utf-8">
<body style="src: url(images/5.jpg);">
<?php

  //连接数据库   
  mysql_connect("localhost","root","1161105403");
   mysql_select_db("neuvideo");
   mysql_query("set names utf8");
//使用$_POST数组获取表单中输入的数据
$typename=$_POST["typename"];


  //插入数据库
    $sql="insert into videotype(tid,typename) values (0,'$typename')";
   // echo $sql.'<br/>';
   //执行SQL语句
  $result = mysql_query($sql) or die('插入失败！'.mysql_error());
  //判断是否插入成功
  $num = mysql_affected_rows();
  if($num!=1){
  	echo "添加失败！<br/>";
  	echo "返回<a href='video_list.php'>返回</a>";	  
  }else{	
	 echo "添加成功！2秒后将返回添加视频类型页。";
  header("refresh:2;url='video_list.php'");    
  } 
 
  //关闭数据库
  mysql_close();  

?>

</body>